/**
 * 
 */

function initAdsLogTable(path,page){
	$.post(path+"operationLogAction_list.action",{
		"op":"%ad%",
		"page":page 
	},function(result){
		result=eval('('+result+')');
		$("#log_databody").empty();
		$("input[type=checkbox]").removeAttr("checked");
		if(result.rescode=='100'){  
			var logList=result.data;
			for(var i=0;i<logList.length;i++){ 
				var log=logList[i];   
				var $e=$('<tr><td><input type="checkbox" value="'+log.uuid+'" class="logch"></td><td>'+moment(log.createTime).format("20YY年MMMDo HH:mm")+'</td><td>'+log.ip+'</td><td>'+log.operation+'</td><td>'+log.opdevice+'</td><td>'+log.params+'</td><td>'+log.url+'</td></tr>');
				$("#log_databody").append($e); 
			}
//			$("#my_blog_list_tbody").append($p);  
//			initMyBlogsPage(path,result.pageBean.curPage,result.pageBean.totalPages); 
			initPages(result.pagebean.curPage,result.pagebean.totalPages);
			
			 
		}else{
			alertError("操作失败");
		}
	});
}


function deladslogs(path){
	$.post(path+"operationLogAction_del.action",{
		ids:getChecked()
	},function(result){
		result=eval('('+result+')');  
		alert(result.msg); 
		if(result.rescode=='100'){
			initAdsLogTable(path,1);  
		}else{

		}
	});
}

/* 获取所有选中项的id字符串   */
function getChecked() {  
	var ids="";
	$("input[type=checkbox]").each(function() {
		if ($(this).prop("checked")) {
			ids+=$(this).val()+",";
		} 
	});
	return ids.substr(0,ids.length-1);
}